<?php

namespace JLPay\Models\Openmerch\Device;

use JLPay\Models\BaseRequest;

/**
 * 设备撤销请求
 */
class DeviceCancelRequest extends BaseRequest
{
    /**
     * API URL
     */
    public const API_URL = '/open/merch/access/device/cancel';

    protected ?string $merchNo = null;
    protected ?string $termNo = null;

    /**
     * 设置商户号
     *
     * @param string $merchNo
     * @return self
     */
    public function setMerchNo(string $merchNo): self
    {
        $this->merchNo = $merchNo;
        return $this;
    }

    /**
     * 设置终端号
     *
     * @param string $termNo
     * @return self
     */
    public function setTermNo(string $termNo): self
    {
        $this->termNo = $termNo;
        return $this;
    }

    /**
     * 获取商户号
     *
     * @return string|null
     */
    public function getMerchNo(): ?string
    {
        return $this->merchNo;
    }

    /**
     * 获取终端号
     *
     * @return string|null
     */
    public function getTermNo(): ?string
    {
        return $this->termNo;
    }

    /**
     * 转换为数组
     *
     * @return array
     */
    public function toArray(): array
    {
        $data = parent::toArray();
        $data['merch_no'] = $this->merchNo;
        $data['term_no'] = $this->termNo;
        return $data;
    }
} 